package com.anjie.powerproject.service.impl;

import com.anjie.powerproject.entity.Point;
import com.anjie.powerproject.entity.TaskConfig;
import com.anjie.powerproject.repository.PointRepository;
import com.anjie.powerproject.repository.TaskConfigRepository;
import com.anjie.powerproject.service.TaskConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskConfigServiceImpl implements TaskConfigService {
    @Autowired
    TaskConfigRepository taskConfigRepository;


    @Override
    public List<TaskConfig> getTaskConfigList() {
        return taskConfigRepository.findAll();
    }

    @Override
    public Integer deleteByDevCode(String devCode) {
        return taskConfigRepository.deleteByDevCode(devCode);
    }

    @Override
    public TaskConfig saveAndFlush(TaskConfig taskConfig) {
        return taskConfigRepository.saveAndFlush(taskConfig);
    }

    @Override
    public List<TaskConfig> getByDevCode(String devCode) {
        return taskConfigRepository.getByDevCode(devCode);
    }

    @Override
    public List<TaskConfig> getByPointId(Integer pointId) { return taskConfigRepository.getByPointId(pointId); }

    @Override
    public List<TaskConfig> saveAll(List<TaskConfig> taskConfigList) {
        return taskConfigRepository.saveAll(taskConfigList);
    }

    @Override
    public Integer deleteByTaskConfigId(Integer id) {
        return taskConfigRepository.deleteByTaskConfigId(id);
    }


}
